package com.itheima.d09_reflect_constructor;

public class Cat {

    private String name;
    private int age;

    private Cat() {
        System.out.println("无参构造方法");
    }

    private Cat(String name) {
        this.name = name;
        System.out.println("有参构造方法：" + name);
    }

    protected Cat(int age) {
        this.age = age;
        System.out.println("有参构造方法：" + age);
    }

    public Cat(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("有参构造方法：" + name + " " + age);
    }

    @Override
    public String toString() {
        return "Cat{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
